package com.itheima.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface ReportMapper extends BaseMapper {

    @Select("select count(tm.ID)as membercounts,concat(rd.fyear,'-',rd.fmonth) as yearandmonths " +
            "from rpt_date rd,t_member tm " +
            "where rd.fdate =tm.REGTIME " +
            "and rd.fyear=year(now())" +
            "group by rd.fmonth")
    List<Map> memberReportByLastYear();

    @Select("select count(tor.ID) as value,ts.name " +
            "from t_order tor,t_setmeal ts " +
            "where tor.SETMEAL_ID = ts.ID " +
            "group by ts.NAME")
    List<Map> setmealProportion();
}
